﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using System.Linq.Expressions;

namespace OperGui.Models
{
    public class Error
    {
        public object Location;
        public object Section;
        public object CustomSection;
        public object Status;
        public object ElementName;
        public object ElementShortId;
        public object Timestamp;
        public object ElementId;
        public object ProblemKey;
        public object SolutionKey;
        public object SortId;
        public object Updated;
        public object RawAreaId;
        public object RawZoneId;
        public object RawSectionId;
        public object MarkCode;
        public object ExtendedId;
        public object Type;

        public object LOCATION
        {
            get { return Location; }
        }


        public Error(Dictionary<string, object> dataSource)
        {
            dataSource.TryGetValue("Location", out Location);
            dataSource.TryGetValue("Section", out Section);
            dataSource.TryGetValue("CustomSection", out CustomSection);
            dataSource.TryGetValue("Status", out Status);
            dataSource.TryGetValue("ElementName", out ElementName);
            dataSource.TryGetValue("ElementShortId", out ElementShortId);
            dataSource.TryGetValue("Timestamp", out Timestamp);
            dataSource.TryGetValue("ElementId", out ElementId);
            dataSource.TryGetValue("ProblemKey", out ProblemKey);
            dataSource.TryGetValue("SolutionKey", out SolutionKey);
            dataSource.TryGetValue("SortId", out SortId);
            dataSource.TryGetValue("Updated", out Updated);
            dataSource.TryGetValue("RawAreaId", out RawAreaId);
            dataSource.TryGetValue("RawZoneId", out RawZoneId);
            dataSource.TryGetValue("RawSectionId", out RawSectionId);
            dataSource.TryGetValue("MarkCode", out MarkCode);
            dataSource.TryGetValue("ExtendedId", out ExtendedId);
            dataSource.TryGetValue("Type", out Type);
        }
    }
}
